<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button>按钮</button>
  <input type="text">
  <button class="cancel">取消</button>

  <script src="./js/hy_throttle.js"></script>
  <script>
    const inputEl = document.querySelector("input")
    const cancelBtn = document.querySelector(".cancel")
    let counter = 1
    const throttleFn = hythrottle(function (event) {
      console.log(`发送网络请求${counter++}:`, this.value, event)
      return "throttle return value"
    }, 3000)
    inputEl.oninput = throttleFn
  </script>

</body>

</html>